﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Ajeelee.Core.Database;
using Ajeelee.Core.Utils;
using FxhjpgWeb.Business;
using FxhjpgWeb.Model;
using FxhjpgWeb.WebSite.Code;
using System.Collections;

namespace FxhjpgWeb.WebSite.ylx
{
    public partial class products : PageBase
    {
        Hashtable table = new Hashtable();
        protected IList<PhotoImgs> photoImgsList = new List<PhotoImgs>();
        IPhotoImgsBusiness photoBll = new PhotoImgsBusinessFactory().CreatePhotoImgsBusiness();
        protected PageStructure ps = new PageStructure() { CurrPage = 1, PageSize = 16 };

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            // 获取参数
            try
            {
                // 接收参数
                if (QueryParamInt32("page") > 1)
                {
                    ps.CurrPage = QueryParamInt32("page");
                }
                table.Add(PhotoImgsHash.CId, 3);
                table.Add(PhotoImgsHash.OrderField, "Sort,P_Id");
                table.Add(PhotoImgsHash.OrderDirection, "asc");
                photoImgsList = photoBll.GetAllPhotoImgsByPage(table, ps);
                this.pager.PageStruct = ps;
            }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}